package com.huhu.controller;

import com.huhu.service.inter.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@RequestMapping("/test")
@Controller
public class TestController {

    @Autowired
    private TestService testService;

    @RequestMapping("/dontSayHello")
    @ResponseBody
    public Object dontSayHello(String hello) {

        int flag = testService.dontSayHello(hello);
        return flag;
    }

    @RequestMapping("/dontSayHello_2")
    @ResponseBody
    public Object dontSayHello_2(String hello) {

        int flag = testService.dontSayHello_2(hello);
        return flag;
    }


    @RequestMapping("/sayHello")
    @ResponseBody
    public Object sayHello(String name) {
        HashMap<String, Map<String, Integer>> map = new HashMap<>();

        HashMap<String, Integer> hashMap = new HashMap<>();

        hashMap.put("A", 1);

        map.put("B", hashMap);


        return map;
    }

}
